package acm;

import java.util.Scanner;

public class a15 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        int[] a = new int[30000];
        int xb=0,yushu;
        if (n==0){
            System.out.print(0);
        }
        while (n!=0){
            xb++;
            yushu=n%16;
            n=n/16;
            if (yushu>9){
                a[xb]=(yushu-10)+'A';
            }
            else {
                a[xb]=yushu;
            }
        }
        for (int i=xb;i>0;i--){
            if (a[i]>9){
                System.out.printf("%c",a[i]);
            }
            else {
                System.out.print(a[i]);
            }
        }
        }
    }

